home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PROGRAM
/
SCLIB.ARJ
/
SCL1SAMP.EXE
/
KEYSTAT.C
< prev
next >
Wrap
Text File
|
1992-01-01
|
1KB
|
62 lines
#include <scl1.h>
#include <scl1keys.h>
/* shows the use of the KeyStatus functions */
main()
{
unsigned int KStat,OldKStat;
KStat=KeyStatus();
do
{
OldKStat = KStat;
if(KStat & ALT)
printf("\n\nALT ON ");
else
printf("\n\nALT OFF");
if(KStat & LSHIFT || KStat & RSHIFT)
printf("\t\tSHIFT ON ");
else
printf("\t\tSHIFT OFF");
if(KStat & CTRL)
printf("\tCONTROL ON ");
else
printf("\tCONTROL OFF");
if(KStat & INSERT)
printf("\tINSERT ON ");
else
printf("\tINSERT OFF");
if(KStat & CAPSL)
printf("\nCAPS LOCK ON ");
else
printf("\nCAPS LOCK OFF");
if(KStat & NUML)
printf("\tNUM LOCK ON ");
else
printf("\tNUM LOCK OFF");
if(KStat & SCROLL)
printf("\tSCROLL LOCK ON ");
else
printf("\tSCROLL LOCK OFF");
printf("\n\nPress any other key to exit\n");
do
{
KStat=KeyStatus();
}while(KStat == OldKStat && !KeyReady());
if(KeyReady()==INS)
ClearKeyBuf();
}while(!KeyReady());
ClearKeyBuf();
}